let mysql=require("mysql")

let ConObj=mysql.createConnection({
    host:"localhost",
    port:"3306",
    user:"root",
    password:"root",
    database:"xiaou"
})
function Query(sql){
   return new Promise((resolve,reject)=>{
    ConObj.query(sql,(err,result)=>{
            if(err){
                resolve([err])
                return
            }else{
                resolve([null,result])
            }

        })
   })
}
// 暴露出去
module.exports=Query